package com.GainLoop;


import android.os.Bundle;
import android.text.Spannable;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.TextView;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Intent;


import com.GainLoop.R;


public class Profile extends Activity {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.profile);
        TextView userInfo= (TextView)findViewById(R.id.showUser);
        userInfo.setMovementMethod(LinkMovementMethod.getInstance());
        
       // Spannable spans = (Spannable) userInfo.getText();
       /*
        ClickableSpan clickSpan = new ClickableSpan() {
        	
           @Override
           public void onClick(View widget)
           {
              //put whatever you like here, below is an example
              AlertDialog.Builder builder = new Builder(Profile.this);
              builder.setTitle("userInfo clicked");
              AlertDialog dialog = builder.create();            
              dialog.show();
           }
        };
        spans.setSpan(clickSpan, 0, spans.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
   	*/
    }
    
    public void showUser(View view){
    	Intent intent=new Intent(Profile.this,UserPage.class);
    	Profile.this.startActivity(intent);
    	
    }
    public boolean onCreateOptionsMenu(Menu menu) {
    	Log.v("menu", "inflating menu..");
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);
        menu.setGroupVisible(R.id.group3, false);
        
        return true;
    }
}